package com.mymoney.persistence.managers;

import java.util.List;

import com.mymoney.beans.CurrencyBean;
import com.mymoney.exceptions.MyMoneyException;
import com.mymoney.persistence.PersistenceContext;

/**
 * 
 * @author yavor.gologanov
 *
 */
public class CurrencyManager extends AbstractBeanManager<CurrencyBean> {

	/**
	 * 
	 * @param persistenceContext
	 */
	public CurrencyManager(PersistenceContext persistenceContext) {
		super(persistenceContext);
	}


	@Override
	public void add(CurrencyBean entity) throws MyMoneyException {
		
		throw new MyMoneyException("Method is not implemented!");
		
	}

	
	@Override
	public List<CurrencyBean> list() throws MyMoneyException {
		
		String queryString = "select d from CurrencyBean d";
		List<CurrencyBean> currencyList = findAllEntities(queryString, -1,(Object[]) null);
		return currencyList;
	}


	@Override
	public CurrencyBean getByCode(long code) throws MyMoneyException {
		
		return getBy("select p from CurrencyBean p where p.code = :code", code, "code");
	}


	@Override
	public CurrencyBean getById(Integer id) throws MyMoneyException {
		throw new MyMoneyException("Method is not implemented!");
	}


	@Override
	public CurrencyBean getByName(String name) throws MyMoneyException {
		
		return getBy("select p from CurrencyBean p where p.name = :name", name, "name");
	}


	@Override
	public void update(CurrencyBean first, CurrencyBean second)
			throws MyMoneyException {
		
		throw new MyMoneyException("Method is not implemented!");
		
	}


	@Override
	public void update(CurrencyBean entity, long code) throws MyMoneyException {
		
		throw new MyMoneyException("Method is not implemented!");
		
	}


	@Override
	public void update(CurrencyBean entity, Integer id) throws MyMoneyException {
		
		throw new MyMoneyException("Method is not implemented!");
		
	}


	@Override
	public void update(CurrencyBean entity, String name)
			throws MyMoneyException {
		
		throw new MyMoneyException("Method is not implemented!");
		
	}

}
